import request from '@/util/request'

// 注册
export const apiRegService = ({ username, password, repassword }) =>
  request.post('/api/reg', { username, password, repassword })

// 登录
export const apiLoginService = ({ username, password }) =>
  request.post('/api/login', { username, password })

// 获取用户的基本信息
export const getMyUserInfoService = () => request.get('/my/userinfo')

// 更新用户基本资料
export const putMyUserInfoService = (data) => request.put('/my/userinfo', data)

// 更新用户头像
export const myUpdateAvatarService = (avatar) =>
  request.patch('/my/update/avatar', avatar)

// 更新用户密码
export const myUpdatePwdService = (data) => request.patch('/my/updatepwd', data)
